gdkwindow: Always pass the impl window to GdkWindowImpl::get_root_coords
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 28 Feb 2014 02:02:22 +0000 (21:02 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 28 Feb 2014 02:06:35 +0000 (21:06 -0500)
The point of GdkWindowImpl::get_root_coords is to translate the passed
in coordinates against the passed-in impl window. For a child window,
in fact, window->abs_x and window->abs_y already track the child
window's coordinates against the impl window.

If we pass in a child window, and backends don't explicitly get the impl
window from it, we'll double-count the child window.

Really, we should *always* be passing impl windows to backends, and
never child windows. However, I'm a bit worried for regressions late
in the cycle if we want to fix up the rest of the callers, like
gdk_window_get_geometry, so I'm only going to touch get_root_coords
for now after careful review of all the backends.

gdk/gdkwindow.c

index f02eb82ef0afac8d55c463d1859e2c8b3e85d461..1a22cd7b450fe2d1e55d504727dc2ffdf804c902 100644 (file)
@@ -6149,7 +6149,7 @@ gdk_window_get_origin (GdkWindow *window,
     }
 
   impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-  impl_class->get_root_coords (window,
+  impl_class->get_root_coords (window->impl_window,
                               window->abs_x,
                               window->abs_y,
                               x, y);
@@ -6191,7 +6191,7 @@ gdk_window_get_root_coords (GdkWindow *window,
     }
   
   impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-  impl_class->get_root_coords (window,
+  impl_class->get_root_coords (window->impl_window,
                               x + window->abs_x,
                               y + window->abs_y,
                               root_x, root_y);